import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;

import java.awt.Font;

import javax.swing.JButton;
import javax.swing.SwingConstants;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.lang.management.GarbageCollectorMXBean;


public class NewPlayerInfoGUI extends JFrame {

	private JPanel contentPane;
	private Table T;
	private JLabel lblNewLabel; 
	/**
	 * Create the frame.
	 */
	public NewPlayerInfoGUI(Table Tablet, int f) {
		setResizable(false);
		
		
		
		this.T=Tablet;
		
		setTitle("Poker - Info");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(400, 250, 500, 150);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		if(f == 1) {
			lblNewLabel = new JLabel(T.PlayerTab[T.activePlayer].y+" Round!"); 
		}
		else {
			lblNewLabel = new JLabel(T.PlayerTab[T.activeBidder].y+" Bid!");
		}
		lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20));
		lblNewLabel.setBounds(50, 11, 371, 37);
		contentPane.add(lblNewLabel);
		
		JButton OkButton = new JButton("OK");
		OkButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) 
			{
				
				getTable().notifier();
				if(T.activePlayer<T.humNum) {
					getTable().notifier();
				}
				killMe();
				
			}
		});
		OkButton.setBounds(196, 59, 89, 23);
		contentPane.add(OkButton);
		setVisible(true);
		
	}
	


	public void killMe()
	{
		setVisible(false);
	}
	public Table getTable()
	{
		return this.T;
	}
}
